<template>
  <div class="regionSelector">
    <!-- 下拉按钮 -->
    <button class="dropdown-trigger">
      <span>{{citySite}}</span>
      <i class="downIcon"></i>
    </button>
    <div class="outerDrop">
      <div class="dropSection">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SiteSelect',
  // 接收父组件传值，value为v-model传过来的属性
  props: ['value'],
  data () {
    return {
      citySite: ''
    }
  },
  created () {
    this.citySite = this.value
    // console.log(this.citySite)
  },
  methods: {
  }
}
</script>

<style scoped lang="less">
.regionSelector{
  position: relative;
}
/* 下拉按钮 */
.dropdown-trigger {
  position: relative;
  margin-right: 8px;
  min-width: 150px;
  text-align: left;
  height: 32px;
  border: none;
  border-bottom: 1px solid #333;
}
.regionSelector:hover .outerDrop {
  display: block;
}
/* 三角箭头 */
.downIcon {
  display: block;
  position: absolute;
  width: 0;
  height: 0;
  right: 0;
  top: 14px;
  border: 6px solid transparent;
  border-top-color: #333;
}
// 下拉框
.outerDrop {
  display: none;
  position: absolute;
  top: 32px;
  left: 0;
}
/* 下拉框 */
.dropSection {
  width: 660px;
  min-height: 425px;
  margin-top: 10px;
  background-color: #fff;
  padding: 10px 20px 20px;
  box-shadow: #787e80 0px 2px 7px;
}
</style>
